//
//  GoldPriceViewController.h
//  AppFrameWork
//
//  Created by Le Anh Tai on 7/21/13.
//  Copyright (c) 2013 Le Anh Tai. All rights reserved.
//

#import "BaseViewController.h"
#import "GoldPriceHeaderView.h"
#import "Global.h"
#import "PullToRefreshView.h"
#import "DetailUpDownPriceCallOutView.h"
#import "AdsCell.h"
#import "HeaderGoldPriceView.h"

#define PRICE_CITY_KEY @"city"
#define PRICE_CITY_ITEMS_KEY @"items"

@interface GoldPriceViewController : BaseViewController<UITableViewDataSource, UITableViewDelegate, PullToRefreshViewDelegate, DetailUpDownPriceCalloutViewDelegate, HeaderGoldPriceViewDelegate>
{
    NSMutableDictionary *_goldPricesDic;
    NSMutableDictionary *_preGoldPricesDic;
    __block BOOL _fetchingSJCGoldPrice;
    __block ThreadStatus _refreshGoldPriceThreadStatus;
    
    BOOL _isPressedRefresh;
    
    PullToRefreshView *_pullToRefreshView;
    DetailUpDownPriceCallOutView *_detailCallOut;
    NSIndexPath *_selectedIndexPath;
    NSInteger _lastContentOffsetY;
    NSString *_curUpdateString;
    NSDate *_lastUpdate;
}

@property (weak, nonatomic) IBOutlet UILabel *titleLabel;
@property (weak, nonatomic) IBOutlet UILabel *worldGoldPriceLabel;
@property (weak, nonatomic) IBOutlet UITableView *tableView;
@property (weak, nonatomic) IBOutlet UILabel *typeLabel;
@property (weak, nonatomic) IBOutlet UILabel *sellLabel;
@property (weak, nonatomic) IBOutlet UILabel *buyLabel;
@property (weak, nonatomic) IBOutlet UILabel *unitLabel;
@property (weak, nonatomic) IBOutlet UIButton *refreshButton;
@property (weak, nonatomic) IBOutlet UIView *headerView;

- (IBAction)refreshButtonPressed:(id)sender;
- (void)saveLastIndexPath;

- (void)removeCalloutView;

@end
